package com.smartcanteen.system.api.clients;

import com.smartcanteen.system.api.domain.entity.AddressBook;
import com.smartcanteen.system.api.domain.entity.Cart;
import com.smartcanteen.system.api.domain.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient("smartcanteen-user")
public interface UserClient {
    @PostMapping("/user/cart/api/list")
    List<Cart> getList(@RequestBody Cart cart);

    @GetMapping("/user/address/api/{id}")
    AddressBook getByIdForApi(@PathVariable("id") Integer id);

    @DeleteMapping("/user/cart/api/clean")
    void cleanCartForApi(@RequestParam("id") Integer id);

    @PostMapping("/api/insertBatch")
    void insertBatch(List<Cart> cartList);

    @GetMapping("/api/getUser")
    User getUserForApi(Integer id);
}
